home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.cs.arizona.edu
/
ftp.cs.arizona.edu.tar
/
ftp.cs.arizona.edu
/
icon
/
newsgrp
/
group97a.txt
/
000085_icon-group-sender _Fri Mar 14 12:27:18 1997.msg
< prev
next >
Wrap
Internet Message Format
|
2000-09-20
|
2KB
Received: by cheltenham.cs.arizona.edu; Sat, 15 Mar 1997 05:54:42 MST
Message-Id: <1.5.4.32.19970314182718.006f6888@post.its.mcw.edu>
X-Sender: cdt@post.its.mcw.edu
X-Mailer: Windows Eudora Light Version 1.5.4 (32)
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Date: Fri, 14 Mar 1997 12:27:18 -0600
To: "Dave Schaumann" <dschauma@csci.csc.com>, icon-group@cs.arizona.edu
From: Chris Tenaglia <cdt@post.its.mcw.edu>
Subject: Re: Recursive directory traversal in Icon
Errors-To: icon-group-errors@cs.arizona.edu
Status: RO
Content-Length: 1816
Traverse a hierarchical directory structure?
Less theory, more samples. How about :
produre dirtrace()
command := "ls -alR"
info := open(command,"pr")
while crunch(read(info))
close(info)
end
procedure crunch(file)
... do something with the files ...
end
I suppose you can modify the ls command to
focus the search, or repackage it using the
unix find command.
In the MSDOS world you might try something
like :
procedure dirtrace()
command := "DIR/S C:\\ >XXX.XXX"
system(command)
info := open("C:\\XXX.XXX")
while crunch(read(info))
close(info)
end
procedure crunch(file)
... do something with the files ...
end
Chris.
At 06:35 PM 3/10/97 GMT, Dave Schaumann wrote:
>
>
>Brian Rogoff <bpr@best.com> wrote in article
><Pine.SGI.3.95.970305103012.2721A-100000@shellx.best.com>...
>> Hi,
>> I've been reading the Icon web references, trying to decide if I
>> should forsake Perl in favor of Icon, and I have two questions.
>>
>> (1) How do I traverse a hierarchical directory structure in Icon? I found
>
>> chdir, but I didn't find the equivalent of 'ls' and 'stat'. Is there
>> a way to do this in Icon, or do you rely on the external environment?
>
>This is one of the biggest weaknessess of Icon, especially wrt languages
>like Perl -- the support for access to the OS is highly limited. The file
>IO system works pretty good, as does the extension to X. But other than
>that, about all that's available is system() and popen() (which may or may
>not have a reasonable analog available on non-Un*x systems).
>
Chris Tenaglia (system manager) | cdt@post.its.mcw.edu
Medical College of Wisconsin |
8701 W. Watertown Plank Rd. | Ce que vous voyez est
Milwaukee, WI 53226 (414)456-8765 | Ce que vous obtenez !